package jm.nj.demo04mian.demo08;
/*
* final修饰的局部变量:一次赋值终身不变
* */
public class Demo {
    public static void main(String[] args) {
        //基本数据类型final固定住变量的值
        final int a = 10;
        //Cannot assign a value to final variable 'a
        //a = 3;
        System.out.println(a);

        //引用数据类型:final固定的是变量地址值
        final Person p =  new Person();
        //p = new Person();
        p.setName("张三");
        p.setAge(18);
        System.out.println(p.getName()+".."+p.getAge());
        p.setName("李四");
        p.setAge(10);
        System.out.println(p.getName()+".."+p.getAge());


    }
}
